home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / freeWAIS-sf-1.1 / lib / ftwtest.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-06  |  661 b   |  46 lines

  1.  
  2. /* Copyright (c) CNIDR (see ../COPYRIGHT) */
  3.  
  4. #include <stdio.h>
  5. #include "../ir/cdialect.h"
  6. /* #include <sys/types.h> */
  7. #include <sys/stat.h>
  8. #include "pdftw.h"
  9.  
  10. extern int alphasort();
  11.  
  12. static int
  13. checkfile(s,st,flag)
  14. char *s;
  15. struct stat *st;
  16. int flag;
  17. {
  18.     printf("name=\"%s\" flag=0x%x\n",s,flag);
  19.     return 0;
  20. }
  21.  
  22. main(ac, av)
  23.     int ac;
  24.     char *av[];
  25. {
  26.     register int i;
  27.     register int j;
  28.     struct dirent **list;
  29.  
  30.     if (ac != 2) {
  31.         fprintf(stderr, "usage: %s dirname\n", av[0]);
  32.         exit(1);
  33.     }
  34.     if (chdir(av[1]) < 0) {
  35.         perror(av[1]);
  36.         exit(1);
  37.     }
  38.  
  39.     if ((i = ftw(".", checkfile, 10 )) < 0) {
  40.         perror("Error walking directory");
  41.         exit(1);
  42.     }
  43.     exit(0);
  44. }
  45.  
  46.